Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

audio: kpb: fix potential NULL pointer dereference in device list reset #9691

Conversation

tmleman
Copy link
Contributor

@tmleman tmleman commented Nov 28, 2024

This patch addresses a potential NULL pointer dereference issue in the devicelist_reset function within the Key Phrase Buffer (KPB) component. The issue was exposed by a recent change in Zephyr's MMU mapping for Intel ADSP ACE30, which now catches NULL pointer accesses.

The devicelist_reset function previously iterated over the entire DEVICE_LIST_SIZE when clearing items and zeroing pointers, which could lead to dereferencing NULL pointers. The fix involves iterating only up to devlist->count to ensure that only valid pointers are accessed.

This change prevents potential NULL pointer dereference and ensures the stability of the KPB component.

This patch addresses a potential NULL pointer dereference issue in the
`devicelist_reset` function within the Key Phrase Buffer (KPB)
component. The issue was exposed by a recent change in Zephyr's MMU
mapping for Intel ADSP ACE30, which now catches NULL pointer accesses.

The `devicelist_reset` function previously iterated over the entire
`DEVICE_LIST_SIZE` when clearing items and zeroing pointers, which could
lead to dereferencing NULL pointers. The fix involves iterating only up
to `devlist->count` to ensure that only valid pointers are accessed.

This change prevents potential NULL pointer dereference and ensures the
stability of the KPB component.

Link: thesofproject#9687

Signed-off-by: Tomasz Leman <[email protected]>
@lgirdwood
Copy link
Member

@tmleman can you check internal CI failure. Thanks !

@kv2019i
Copy link
Collaborator

kv2019i commented Dec 3, 2024

SOFCI TEST

@kv2019i
Copy link
Collaborator

kv2019i commented Dec 3, 2024

SOFCI TEST

@lgirdwood lgirdwood merged commit d9bef48 into thesofproject:main Dec 3, 2024
45 of 47 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants